/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entityprojet;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Ron
 */
@Entity
@Table(name = "F_CATALOGUE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FCatalogue.findAll", query = "SELECT f FROM FCatalogue f"),
    @NamedQuery(name = "FCatalogue.findByCLNo", query = "SELECT f FROM FCatalogue f WHERE f.cLNo = :cLNo"),
    @NamedQuery(name = "FCatalogue.findByCLIntitule", query = "SELECT f FROM FCatalogue f WHERE f.cLIntitule = :cLIntitule"),
    @NamedQuery(name = "FCatalogue.findByCLCode", query = "SELECT f FROM FCatalogue f WHERE f.cLCode = :cLCode"),
    @NamedQuery(name = "FCatalogue.findByCLStock", query = "SELECT f FROM FCatalogue f WHERE f.cLStock = :cLStock"),
    @NamedQuery(name = "FCatalogue.findByCLNoParent", query = "SELECT f FROM FCatalogue f WHERE f.cLNoParent = :cLNoParent"),
    @NamedQuery(name = "FCatalogue.findByCLNiveau", query = "SELECT f FROM FCatalogue f WHERE f.cLNiveau = :cLNiveau"),
    @NamedQuery(name = "FCatalogue.findByCbProt", query = "SELECT f FROM FCatalogue f WHERE f.cbProt = :cbProt"),
    @NamedQuery(name = "FCatalogue.findByCbMarq", query = "SELECT f FROM FCatalogue f WHERE f.cbMarq = :cbMarq"),
    @NamedQuery(name = "FCatalogue.findByCbCreateur", query = "SELECT f FROM FCatalogue f WHERE f.cbCreateur = :cbCreateur"),
    @NamedQuery(name = "FCatalogue.findByCbModification", query = "SELECT f FROM FCatalogue f WHERE f.cbModification = :cbModification"),
    @NamedQuery(name = "FCatalogue.findByCbReplication", query = "SELECT f FROM FCatalogue f WHERE f.cbReplication = :cbReplication"),
    @NamedQuery(name = "FCatalogue.findByCbFlag", query = "SELECT f FROM FCatalogue f WHERE f.cbFlag = :cbFlag")})
public class FCatalogue implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "CL_No")
    private Integer cLNo;
    @Basic(optional = false)
    @Column(name = "CL_Intitule")
    private String cLIntitule;
    @Lob
    @Column(name = "cbCL_Intitule")
    private byte[] cbCLIntitule;
    @Column(name = "CL_Code")
    private String cLCode;
    @Column(name = "CL_Stock")
    private Short cLStock;
    @Column(name = "CL_NoParent")
    private Integer cLNoParent;
    @Column(name = "CL_Niveau")
    private Short cLNiveau;
    @Column(name = "cbProt")
    private Short cbProt;
    @Id
    @Basic(optional = false)
    @Column(name = "cbMarq")
    private Integer cbMarq;
    @Column(name = "cbCreateur")
    private String cbCreateur;
    @Column(name = "cbModification")
    @Temporal(TemporalType.TIMESTAMP)
    private Date cbModification;
    @Column(name = "cbReplication")
    private Integer cbReplication;
    @Column(name = "cbFlag")
    private Short cbFlag;
    @OneToMany(mappedBy = "cbCLNo1")
    private Collection<FArticle> fArticleCollection;
    @OneToMany(mappedBy = "cbCLNo2")
    private Collection<FArticle> fArticleCollection1;
    @OneToMany(mappedBy = "cbCLNo3")
    private Collection<FArticle> fArticleCollection2;
    @OneToMany(mappedBy = "cbCLNo4")
    private Collection<FArticle> fArticleCollection3;
    @OneToMany(mappedBy = "cbCLNoParent")
    private Collection<FCatalogue> fCatalogueCollection;
    @JoinColumn(name = "cbCL_NoParent", referencedColumnName = "CL_No")
    @ManyToOne
    private FCatalogue cbCLNoParent;

    public FCatalogue() {
    }

    public FCatalogue(Integer cbMarq) {
        this.cbMarq = cbMarq;
    }

    public FCatalogue(Integer cbMarq, String cLIntitule) {
        this.cbMarq = cbMarq;
        this.cLIntitule = cLIntitule;
    }

    public Integer getCLNo() {
        return cLNo;
    }

    public void setCLNo(Integer cLNo) {
        this.cLNo = cLNo;
    }

    public String getCLIntitule() {
        return cLIntitule;
    }

    public void setCLIntitule(String cLIntitule) {
        this.cLIntitule = cLIntitule;
    }

    public byte[] getCbCLIntitule() {
        return cbCLIntitule;
    }

    public void setCbCLIntitule(byte[] cbCLIntitule) {
        this.cbCLIntitule = cbCLIntitule;
    }

    public String getCLCode() {
        return cLCode;
    }

    public void setCLCode(String cLCode) {
        this.cLCode = cLCode;
    }

    public Short getCLStock() {
        return cLStock;
    }

    public void setCLStock(Short cLStock) {
        this.cLStock = cLStock;
    }

    public Integer getCLNoParent() {
        return cLNoParent;
    }

    public void setCLNoParent(Integer cLNoParent) {
        this.cLNoParent = cLNoParent;
    }

    public Short getCLNiveau() {
        return cLNiveau;
    }

    public void setCLNiveau(Short cLNiveau) {
        this.cLNiveau = cLNiveau;
    }

    public Short getCbProt() {
        return cbProt;
    }

    public void setCbProt(Short cbProt) {
        this.cbProt = cbProt;
    }

    public Integer getCbMarq() {
        return cbMarq;
    }

    public void setCbMarq(Integer cbMarq) {
        this.cbMarq = cbMarq;
    }

    public String getCbCreateur() {
        return cbCreateur;
    }

    public void setCbCreateur(String cbCreateur) {
        this.cbCreateur = cbCreateur;
    }

    public Date getCbModification() {
        return cbModification;
    }

    public void setCbModification(Date cbModification) {
        this.cbModification = cbModification;
    }

    public Integer getCbReplication() {
        return cbReplication;
    }

    public void setCbReplication(Integer cbReplication) {
        this.cbReplication = cbReplication;
    }

    public Short getCbFlag() {
        return cbFlag;
    }

    public void setCbFlag(Short cbFlag) {
        this.cbFlag = cbFlag;
    }

    @XmlTransient
    public Collection<FArticle> getFArticleCollection() {
        return fArticleCollection;
    }

    public void setFArticleCollection(Collection<FArticle> fArticleCollection) {
        this.fArticleCollection = fArticleCollection;
    }

    @XmlTransient
    public Collection<FArticle> getFArticleCollection1() {
        return fArticleCollection1;
    }

    public void setFArticleCollection1(Collection<FArticle> fArticleCollection1) {
        this.fArticleCollection1 = fArticleCollection1;
    }

    @XmlTransient
    public Collection<FArticle> getFArticleCollection2() {
        return fArticleCollection2;
    }

    public void setFArticleCollection2(Collection<FArticle> fArticleCollection2) {
        this.fArticleCollection2 = fArticleCollection2;
    }

    @XmlTransient
    public Collection<FArticle> getFArticleCollection3() {
        return fArticleCollection3;
    }

    public void setFArticleCollection3(Collection<FArticle> fArticleCollection3) {
        this.fArticleCollection3 = fArticleCollection3;
    }

    @XmlTransient
    public Collection<FCatalogue> getFCatalogueCollection() {
        return fCatalogueCollection;
    }

    public void setFCatalogueCollection(Collection<FCatalogue> fCatalogueCollection) {
        this.fCatalogueCollection = fCatalogueCollection;
    }

    public FCatalogue getCbCLNoParent() {
        return cbCLNoParent;
    }

    public void setCbCLNoParent(FCatalogue cbCLNoParent) {
        this.cbCLNoParent = cbCLNoParent;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cbMarq != null ? cbMarq.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FCatalogue)) {
            return false;
        }
        FCatalogue other = (FCatalogue) object;
        if ((this.cbMarq == null && other.cbMarq != null) || (this.cbMarq != null && !this.cbMarq.equals(other.cbMarq))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.FCatalogue[ cbMarq=" + cbMarq + " ]";
    }
    
}
